﻿$("#exampleAccordion>li:nth-child(7) a").removeClass("collapsed");
$("#exampleAccordion>li:nth-child(7) ul").addClass("show");
$("#exampleAccordion>li:nth-child(7) ul>li:nth-child(5)").addClass("active");
function submit() {
    var bootstrapValidator = $(".register").data('bootstrapValidator');
    bootstrapValidator.validate();
    if (bootstrapValidator.isValid()) {
        var option = {
            type: 'post', 
            url: '/Register/Indexs',
            data: { mUP: $("#MSuperior").val(), eUP: $("#expSuperior").val(), content: $("#Content").val(), userName: $("#user").val(), mobile: $("#mobile").val(), type: $("#type").val()},
            callback: SetMode
        }
        swGather.swAjax(option)
    }
}

function SetMode(data) {
    layer.alert('账号: ' + data.Account + '</br>密码: ' + data.PWD1 + '</br>二级密码: ' + data.PWD1 + '', {
        title: '注册完成,账号密码',
        skin: 'layui-layer-lan', //样式类名
        closeBtn: 0
    });
}

//验证
$(".register").bootstrapValidator({
    message: '无效的值',
    feedbackIcons: {
        valid: 'glyphicon glyphicon-ok',
        invalid: 'glyphicon glyphicon-remove',
        validating: 'glyphicon glyphicon-refresh',
    },
    fields: {
        user: {
            message: '无效的数值',
            validators: {
                notEmpty: {
                    message: '用户名，不能为空的'
                }
            }
        },
        mobile: {
            message: '无效的数值',
            validators: {
                notEmpty: {
                    message: '手机号，不能为空的'
                },
                regexp: {
                    regexp: /^1[34578]\d{9}$/,
                    message: '请输入正确的手机号'
                }
            }
        }
    }
})